Add Data Column
AutomatR.DefaultActivities.Datatable.AddDataColumn
The "Add Data Column" activity in AutomatR is part of the DataTable activities package, designed to facilitate the addition of a data column to a specified DataTable. This activity provides flexibility in defining the characteristics of the new column, such as its name, data type, and optional settings like allowing null values, auto-increment, default value, uniqueness, and maximum length.
Properties
Name | Description |
---|---|
Input | |
Column | Specifies a DataColumn object that needs to be added to the existing DataTable. DataColumn variables containing the definition of the column to be added. |
Column Name | Specifies the name of the new column to be inserted into the table. String variables containing the desired column name. |
Data Table | Specifies the DataTable variable that has extracted data from other inbound activities. DataTable variables containing the target DataTable. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Allow Null | Specifies whether to allow null values in the new column. Boolean variables determining whether to allow null values. |
Auto Increment | Specifies whether to allow the column to increment automatically when a new row is added. Boolean variables determining whether to enable auto-increment. |
Default Value | Specifies the default value for the new column when creating new rows. String variables containing the default value. |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Add Data Column" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Max Length | Specifies the maximum length for each row of the new column. Integer variables containing the maximum length. |
Unique | Specifies whether the values in each row of the new column should be unique. Boolean variables determining whether to enforce uniqueness. |
How to use:
- Drag and drop the "Add Data Column" activity onto the workflow.
- Configure the properties by specifying the DataColumn object, column name, DataTable variable, and other optional settings.
- Optionally, configure the delay.
- Execute the workflow to add the specified column to the DataTable.
Example: Consider an example where the "Add Data Column" activity is used to add a new column named "Age" to an existing DataTable:
Add Data Column:
Data Table: existingDataTable
Column Name: "Age"
Allow Null: False
Auto Increment: False
Unique: False
Max Length: 3
In this example, the activity adds a new column named "Age" to the "existingDataTable" DataTable, specifying that null values are not allowed, auto-increment is disabled, uniqueness is not enforced, and the maximum length is set to 3 characters for each row.